<html>
<head><meta charset="utf-8"><title>subset relations and polonius · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html">subset relations and polonius</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167212574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167212574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167212574">(Jun 03 2019 at 17:34)</a>:</h4>
<p>So I had a long chat with <span class="user-mention" data-user-id="127262">@Aaron Weiss</span> today and I think we convinced ourselves that the polonius model needs a modest but non-trivial revision. The good news is that it becomes at once simpler and more precise.</p>



<a name="167212651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167212651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167212651">(Jun 03 2019 at 17:35)</a>:</h4>
<p>The good news is that, in the end, we will no longer need to propagate the <code>subset</code> relation between points -- only the (transitive) <code>contains</code> relation. However, we will have to do a "pre-pass" that looks for cycles amongst the subset relations established at any point and performs unification. (Or this could potentially happen during type-check.)</p>



<a name="167212665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167212665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167212665">(Jun 03 2019 at 17:35)</a>:</h4>
<p>(This will also mean <span class="user-mention" data-user-id="116113">@lqd</span> that we wind up wanting to create "placeholder loans" to handle illegal subset relations.)</p>



<a name="167212804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167212804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167212804">(Jun 03 2019 at 17:37)</a>:</h4>
<p>oh interesting</p>



<a name="167212883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167212883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167212883">(Jun 03 2019 at 17:38)</a>:</h4>
<p>is there any bad news ? :)</p>



<a name="167212926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167212926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167212926">(Jun 03 2019 at 17:38)</a>:</h4>
<p>(apart from being a non-trivial piece of work, that is)</p>



<a name="167212975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167212975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167212975">(Jun 03 2019 at 17:39)</a>:</h4>
<p>do we already have an intuition about what the increased precision buys us ?</p>



<a name="167213105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213105">(Jun 03 2019 at 17:40)</a>:</h4>
<p>I think it will be better overall</p>



<a name="167213116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213116">(Jun 03 2019 at 17:40)</a>:</h4>
<p>Here is an example where existing polonius is imprecise:</p>



<a name="167213139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213139">(Jun 03 2019 at 17:41)</a>:</h4>
<p>we should check that ;)</p>



<a name="167213166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213166">(Jun 03 2019 at 17:41)</a>:</h4>
<p>(the problems prompting this change would also be interesting to learn :)</p>



<a name="167213283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213283">(Jun 03 2019 at 17:42)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span>: <span class="kp">&amp;</span><span class="na">&#39;x</span><span class="w"> </span><span class="kt">u32</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">y</span>: <span class="kp">&amp;</span><span class="na">&#39;y</span><span class="w"> </span><span class="kt">u32</span><span class="p">;</span><span class="w"></span>

<span class="k">if</span><span class="w"> </span><span class="n">something</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="c1">// creates `&#39;x: &#39;y` subset relation</span>
<span class="p">}</span><span class="w"></span>

<span class="k">if</span><span class="w"> </span><span class="n">something</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">z</span><span class="p">;</span><span class="w"> </span><span class="c1">// creates {L0} in &#39;x constraint</span>
<span class="w">  </span><span class="c1">// this point, we have `&#39;x: &#39;y` and `{L0} in `&#39;x`, so we also have `{L0} in &#39;y`</span>
<span class="w">  </span><span class="n">drop</span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="n">z</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="c1">// polonius flags an (unnecessary) error</span>

<span class="n">drop</span><span class="p">(</span><span class="n">y</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="167213310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213310">(Jun 03 2019 at 17:42)</a>:</h4>
<p>the problem here is that the loan L0 makes its way into <code>'y</code> but it shouldn't</p>



<a name="167213346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213346">(Jun 03 2019 at 17:43)</a>:</h4>
<p>I'd be happy to schedule a call and try to talk out the intuitions here -- it was helpful to discuss with <span class="user-mention" data-user-id="127262">@Aaron Weiss</span> and I imagine trying to explain it a few more times would be helpful too :)</p>



<a name="167213363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213363">(Jun 03 2019 at 17:43)</a>:</h4>
<p>which reminds me that I'm not sure if I ever posted that polonius lecture from a few days back</p>



<a name="167213369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213369">(Jun 03 2019 at 17:43)</a>:</h4>
<p>and by days I mean months or whatever :P</p>



<a name="167213384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213384">(Jun 03 2019 at 17:44)</a>:</h4>
<p>:)</p>



<a name="167213419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213419">(Jun 03 2019 at 17:44)</a>:</h4>
<p>I thinkI ran into problems because it had some errant notifications I had to edit out</p>



<a name="167213422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213422">(Jun 03 2019 at 17:44)</a>:</h4>
<p>yeah</p>



<a name="167213423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213423">(Jun 03 2019 at 17:44)</a>:</h4>
<p>and I never found a satisafactory way of doing that :)</p>



<a name="167213428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213428">(Jun 03 2019 at 17:44)</a>:</h4>
<p>despite purchasing Adobe Premiere</p>



<a name="167213429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213429">(Jun 03 2019 at 17:44)</a>:</h4>
<p>I don't think we posted this one yet</p>



<a name="167213451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213451">(Jun 03 2019 at 17:44)</a>:</h4>
<p>should just open up my mac where such stuff is easy</p>



<a name="167213453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213453">(Jun 03 2019 at 17:44)</a>:</h4>
<p>that's very understandable</p>



<a name="167213536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213536">(Jun 03 2019 at 17:45)</a>:</h4>
<p>video editing takes time, which is rare and precious :)</p>



<a name="167213554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213554">(Jun 03 2019 at 17:45)</a>:</h4>
<p>it's really rather painful on my surface</p>



<a name="167213607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213607">(Jun 03 2019 at 17:46)</a>:</h4>
<p>I'm not sure if that's windows fault, or the hardware isn't up to it, or what</p>



<a name="167213662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213662">(Jun 03 2019 at 17:46)</a>:</h4>
<p>a call with Albin also, discussing this could be nice indeed</p>



<a name="167213728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213728">(Jun 03 2019 at 17:47)</a>:</h4>
<p>(I'd need to prepare a bit, and it could be tight wrt scheduling, but definitely worthwhile)</p>



<a name="167213759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167213759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167213759">(Jun 03 2019 at 17:48)</a>:</h4>
<p>that example is interesting</p>



<a name="167214183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214183">(Jun 03 2019 at 17:52)</a>:</h4>
<p>and the idea of limiting the  <code>subset</code> TC = &lt;3</p>



<a name="167214219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214219">(Jun 03 2019 at 17:52)</a>:</h4>
<p>the other relevant example (the one that motivated propagating subset relations in the first place) is</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">v</span>: <span class="nb">Vec</span><span class="o">&lt;&amp;</span><span class="na">&#39;v</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[];</span><span class="w"></span>

<span class="kd">let</span><span class="w"> </span><span class="n">p</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="nb">Vec</span><span class="o">&lt;&amp;</span><span class="na">&#39;p</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">q</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="c1">// creates L0</span>
<span class="n">v</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">q</span><span class="p">);</span><span class="w"> </span><span class="c1">// adds L0 to &#39;p, needs to *indirectly* add to `&#39;v`</span>

<span class="n">x</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="c1">// should be an error</span>
<span class="n">drop</span><span class="p">(</span><span class="n">v</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="167214248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214248">(Jun 03 2019 at 17:53)</a>:</h4>
<p>today this works because we create <code>'v: 'p</code> and <code>'p: 'v</code> at the <code>&amp;mut v</code> point</p>



<a name="167214250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214250">(Jun 03 2019 at 17:53)</a>:</h4>
<p>and we propagate those forward</p>



<a name="167214259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214259">(Jun 03 2019 at 17:53)</a>:</h4>
<p>but the alternate we propose is to detect that cycle and basically unify <code>'v</code> and <code>'p</code> before polonius runs (or as a pre-pass in polonius, unclear)</p>



<a name="167214347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214347">(Jun 03 2019 at 17:54)</a>:</h4>
<p>so that the program is effectively</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">v</span>: <span class="nb">Vec</span><span class="o">&lt;&amp;</span><span class="na">&#39;v</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[];</span><span class="w"></span>

<span class="kd">let</span><span class="w"> </span><span class="n">p</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="nb">Vec</span><span class="o">&lt;&amp;</span><span class="na">&#39;v</span><span class="w"> </span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">q</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="c1">// creates L0</span>
<span class="n">v</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">q</span><span class="p">);</span><span class="w"> </span><span class="c1">// adds L0 to &#39;v</span>

<span class="n">x</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="c1">// is an error because `L0 in &#39;v` and `v` is live</span>
<span class="n">drop</span><span class="p">(</span><span class="n">v</span><span class="p">);</span><span class="w"></span>
</pre></div>



<a name="167214361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214361">(Jun 03 2019 at 17:54)</a>:</h4>
<p>(arguably a more straight-forward approach)</p>



<a name="167214421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214421">(Jun 03 2019 at 17:55)</a>:</h4>
<p>seems simpler indeed</p>



<a name="167214532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214532">(Jun 03 2019 at 17:56)</a>:</h4>
<p>it seems like it'd be potentially nice to do this in polonius, but I'm not really sure how to encode cycle detection in datafrog. I recall <span class="user-mention" data-user-id="116609">@Frank McSherry</span> has some examples for differential dataflow at least though.</p>



<a name="167214551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214551">(Jun 03 2019 at 17:56)</a>:</h4>
<p>very interesting, I'll need to look into this more for sure</p>



<a name="167214579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214579">(Jun 03 2019 at 17:57)</a>:</h4>
<p>(it'd be "not terribly hard" to do on the rust side too)</p>



<a name="167214624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214624">(Jun 03 2019 at 17:58)</a>:</h4>
<p>(I wonder if Frank's recent talk was recorded/publicly available)</p>



<a name="167214666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214666">(Jun 03 2019 at 17:58)</a>:</h4>
<p>There's still something mildly bugging me about using cycles in the subset relations to decide what has to be equal but I can't quite put my finger on it. It's just strange to me that the combination of <code>a &lt;= b</code> and <code>b &lt;= a</code> is distinct from the effect of each statement independently (in that it kind of propagates throughout the whole graph)</p>



<a name="167214691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214691">(Jun 03 2019 at 17:58)</a>:</h4>
<p>But I think what it boils down is that there is some <em>more precise</em> situation when you would need equality but we don't quite have the tool to capture that</p>



<a name="167214703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214703">(Jun 03 2019 at 17:58)</a>:</h4>
<p>and maybe it doesn't matter in practice</p>



<a name="167214707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214707">(Jun 03 2019 at 17:58)</a>:</h4>
<p>I haven't come up with a good example where it would</p>



<a name="167214751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214751">(Jun 03 2019 at 17:59)</a>:</h4>
<blockquote>
<p>(I wonder if Frank's recent talk was recorded/publicly available)</p>
</blockquote>
<p>I was talking to Frank about giving a talk over Zoom at some point (a "rustc lecture series" sort of talk)</p>



<a name="167214758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214758">(Jun 03 2019 at 17:59)</a>:</h4>
<p>but we never decided on a date or topic I think :)</p>



<a name="167214772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214772">(Jun 03 2019 at 17:59)</a>:</h4>
<p>I HAVE BEEN SUMMONED!</p>



<a name="167214843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214843">(Jun 03 2019 at 18:00)</a>:</h4>
<blockquote>
<p>I haven't come up with a good example where it would</p>
</blockquote>
<p>it's also a bit harder for me to think about these in the abstract, coming up with examples in these subtle edge cases</p>



<a name="167214852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167214852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167214852">(Jun 03 2019 at 18:00)</a>:</h4>
<p>What do you need to do with cycle detection, now? Like, strongly connected components, or something simpler?</p>



<a name="167215029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215029">(Jun 03 2019 at 18:02)</a>:</h4>
<blockquote>
<p>nikomatsakis: but we never decided on a date or topic I think :)</p>
</blockquote>
<p>I did a meet-up on Rust and Datalog just recently, kind of as a warm up to this. I've been thinking about it, but also not 100% sure I grok what would be most interesting and useful.</p>



<a name="167215232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215232">(Jun 03 2019 at 18:05)</a>:</h4>
<blockquote>
<p>What do you need to do with cycle detection, now? Like, strongly connected components, or something simpler?</p>
</blockquote>
<p>SCC -- we have these "subset" relations like <code>a &lt;= b</code> and we would need to detect cases where, at some point P, there is a <code>a &lt;= b</code> and <code>b &lt;= a</code> and then "unify" a and b at all other points</p>



<a name="167215263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215263">(Jun 03 2019 at 18:06)</a>:</h4>
<p>(as I wrote above, though, it's not clear this should be done in polonius)</p>



<a name="167215480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215480">(Jun 03 2019 at 18:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116609">@Frank McSherry</span> I can try to write up some pseduo-rules to better communicate what I mean, but in short I want to do a series of SCC computations and compute equality classes ("unification"-like)</p>



<a name="167215483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215483">(Jun 03 2019 at 18:08)</a>:</h4>
<p>maybe too short</p>



<a name="167215695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215695">(Jun 03 2019 at 18:10)</a>:</h4>
<p>To just throw out some information: cycle <em>detection</em> is pretty easy in differential dataflow, and probably also in datalog (maybe?). However, this is just the problem of detecting if there is a cycle, which can be less than what you might want.</p>
<p>What you <em>might</em> want is the strongly connected component decomposition, which assigns to each node an identifier such that nodes with the same identifier have the same transitive reachability information. Everyone in a cycle would get the same identifier, but you could have a graph with multiple cycles each of which shouldn't get the same identifiers. Because graphs may not be symmetric, you might have some cycles that can reach other cycles, but not vice-versa, and that needs to be accurately reflected.</p>



<a name="167215744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215744">(Jun 03 2019 at 18:11)</a>:</h4>
<p>we definitely more than just knowing <em>if</em> there is a cycle, we want to be able to say what the members are of each cycle</p>



<a name="167215761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215761">(Jun 03 2019 at 18:11)</a>:</h4>
<p>that said, the graphs are probably very small</p>



<a name="167215770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215770">(Jun 03 2019 at 18:12)</a>:</h4>
<p>so it occurs to me that something naive, like computing reachability, might suffice</p>



<a name="167215824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215824">(Jun 03 2019 at 18:12)</a>:</h4>
<p>though I would need some way to get a "representative"</p>



<a name="167215852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215852">(Jun 03 2019 at 18:12)</a>:</h4>
<p>I can sort of imagine how to do this, I guess...</p>



<a name="167215863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215863">(Jun 03 2019 at 18:12)</a>:</h4>
<p>I'll try to toy with something later on maybe</p>



<a name="167215922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167215922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167215922">(Jun 03 2019 at 18:13)</a>:</h4>
<p>So, SCC computation is a packaged program in differential dataflow (<a href="https://github.com/TimelyDataflow/differential-dataflow/blob/master/src/algorithms/graphs/scc.rs" target="_blank" title="https://github.com/TimelyDataflow/differential-dataflow/blob/master/src/algorithms/graphs/scc.rs">https://github.com/TimelyDataflow/differential-dataflow/blob/master/src/algorithms/graphs/scc.rs</a>) which .. it could use some love to make it a bit easier to grok the input and output ... but.</p>



<a name="167216054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167216054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167216054">(Jun 03 2019 at 18:15)</a>:</h4>
<blockquote>
<p>nikomatsakis: though I would need some way to get a "representative"</p>
</blockquote>
<p>What the SCC code in DD looks like is: you show up with a graph with node identifiers, and edges between identifiers. It then does a bunch of computational magic and comes back with a collection of pairs <code>(Node, Node)</code> where each node exists in the first position, and has the smallest node identifier in its SCC in the second position.</p>



<a name="167216133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167216133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167216133">(Jun 03 2019 at 18:16)</a>:</h4>
<p>So you get a representative for free, but it happens to be one that we choose (if there were another rule about which node identifier you want to propagate, that could work too, but "smallest" is really easy).</p>



<a name="167216178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167216178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167216178">(Jun 03 2019 at 18:16)</a>:</h4>
<p>Strictly speaking, the code at the moment actually returns the edges within SCCs rather than the SCCs themselves, but .. I could fix that pretty quick if and when you want to try things out.</p>



<a name="167216228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167216228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank McSherry <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167216228">(Jun 03 2019 at 18:17)</a>:</h4>
<p>You could also just use a vanilla SCC algorithm, which will go much faster if you aren't yet at "inputs change and we want to react quickly" yet.</p>



<a name="167222514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167222514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167222514">(Jun 03 2019 at 19:23)</a>:</h4>
<blockquote>
<p>So you get a representative for free, but it happens to be one that we choose (if there were another rule about which node identifier you want to propagate, that could work too, but "smallest" is really easy).</p>
</blockquote>
<p>this is roughly what I had in mind, yes.</p>



<a name="167229213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167229213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167229213">(Jun 03 2019 at 20:37)</a>:</h4>
<p>would we expect the motivating example to fail in Polonius today, or would it require supporting illegal subset relations errors ?</p>



<a name="167231145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167231145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167231145">(Jun 03 2019 at 20:55)</a>:</h4>
<p>(I saw this conversation, but I'm going to bed so I'll read it properly tomorrow!)</p>



<a name="167232679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232679">(Jun 03 2019 at 21:13)</a>:</h4>
<p>(I'm not seeing it yet, and expected L0 to be killed after the 2nd if, so no unnecessary Polonius error here <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> ?)</p>



<a name="167232853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232853">(Jun 03 2019 at 21:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> did you actually try it?</p>



<a name="167232874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232874">(Jun 03 2019 at 21:15)</a>:</h4>
<p>yes :/</p>



<a name="167232876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232876">(Jun 03 2019 at 21:15)</a>:</h4>
<p>I would expect an error today, but it may take a bit of tweaking to set it up correctly :)</p>



<a name="167232879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232879">(Jun 03 2019 at 21:15)</a>:</h4>
<p>right</p>



<a name="167232905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232905">(Jun 03 2019 at 21:15)</a>:</h4>
<p>the tweaking must be what I'm missing indeed</p>



<a name="167232977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232977">(Jun 03 2019 at 21:16)</a>:</h4>
<p>what is the example as you have it setup?</p>



<a name="167232993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167232993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167232993">(Jun 03 2019 at 21:16)</a>:</h4>
<p>say, <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=cb0c551c37d12ca83c176b6777845db4" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=cb0c551c37d12ca83c176b6777845db4">this</a> will faill with just nlls but work in Polonius</p>



<a name="167233104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233104">(Jun 03 2019 at 21:18)</a>:</h4>
<p>(eternal personal reminder to add <code>-Z</code> support to the playground)</p>



<a name="167233134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233134">(Jun 03 2019 at 21:18)</a>:</h4>
<p>(it's also worth noting that I could be missing something)</p>



<a name="167233187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233187">(Jun 03 2019 at 21:19)</a>:</h4>
<p>but ok I think I see why it's not reproducing, let me think about the most elegant variant :)</p>



<a name="167233193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233193">(Jun 03 2019 at 21:19)</a>:</h4>
<p>I guess I can test this wth <code>-Zpolonius</code> myself</p>



<a name="167233314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233314">(Jun 03 2019 at 21:21)</a>:</h4>
<p>(I did have a mockup with <code>-Z</code> support to the playground, and eddy often asks ;)</p>



<a name="167233417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233417">(Jun 03 2019 at 21:22)</a>:</h4>
<p>I think something like this is probably good: <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=52fbcbf0fdf3c55542476842053994a6" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=52fbcbf0fdf3c55542476842053994a6">playground</a></p>



<a name="167233436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233436">(Jun 03 2019 at 21:23)</a>:</h4>
<p>I basically just changed from <code>let mut x: &amp;u32</code> to <code>let mut x: (&amp;u32,) = ...</code></p>



<a name="167233443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233443">(Jun 03 2019 at 21:23)</a>:</h4>
<p>so that the <code>x.0 = ...</code> doesn't completely kill</p>



<a name="167233464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233464">(Jun 03 2019 at 21:23)</a>:</h4>
<p>you could probably make a more realistic example with <code>vec![]</code> and <code>push</code> or something</p>



<a name="167233480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233480">(Jun 03 2019 at 21:23)</a>:</h4>
<p>I <em>think</em> the new formulation I am proposing would handle the example above</p>



<a name="167233540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233540">(Jun 03 2019 at 21:24)</a>:</h4>
<p>ah yes, it does trigger thanks a lot</p>



<a name="167233684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167233684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167233684">(Jun 03 2019 at 21:26)</a>:</h4>
<blockquote>
<p>I <em>think</em> the new formulation I am proposing would handle the example above</p>
</blockquote>
<p>maybe we can prototype it "quickly"</p>



<a name="167234112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167234112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167234112">(Jun 03 2019 at 21:32)</a>:</h4>
<p>Hmm, yes.</p>



<a name="167234211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167234211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167234211">(Jun 03 2019 at 21:34)</a>:</h4>
<p>it'd be useful if we added some <code>min</code>-like operators to datafrog somewhere</p>



<a name="167234214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167234214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167234214">(Jun 03 2019 at 21:34)</a>:</h4>
<p>question is precisely <em>where</em> :)</p>



<a name="167234647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167234647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167234647">(Jun 03 2019 at 21:41)</a>:</h4>
<p>well you know</p>



<a name="167234657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167234657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167234657">(Jun 03 2019 at 21:41)</a>:</h4>
<p>we could pretty easily write the code we need in polonius in <em>rust</em> I guess</p>



<a name="167235110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167235110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167235110">(Jun 03 2019 at 21:47)</a>:</h4>
<p>(yeah that's what I was thinking as well, I was wondering about the updated rules, if we just needed to simply not do the <code>subset</code> TC — probably not)</p>



<a name="167244334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167244334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167244334">(Jun 04 2019 at 00:14)</a>:</h4>
<p>( <span aria-label="up" class="emoji emoji-2b06" role="img" title="up">:up:</span> was misspoken, as IIRC the TC at a single point would not change, but propagating subsets along the CFG would not be necessary anymore)</p>



<a name="167276539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167276539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167276539">(Jun 04 2019 at 09:55)</a>:</h4>
<blockquote>
<p>we could pretty easily write the code we need in polonius in <em>rust</em> I guess</p>
</blockquote>
<p>There is a great joke here about everyone rewriting their C(++) stuff in Rust, and the Rust people now basically inventing something else to rewrite parts of Rust in because Rust is already in Rust</p>



<a name="167308748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167308748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167308748">(Jun 04 2019 at 15:58)</a>:</h4>
<p>Ok, I have read through this but <em>not</em> fully digested it. I think I'll need some more examples and/or careful deductions on paper (for/by myself) to figure this out. Which is good, because it reminds me that I should go through the actual borrow check logic and make sure I understand it too, and not just the parts I'm working on.</p>



<a name="167310413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167310413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167310413">(Jun 04 2019 at 16:13)</a>:</h4>
<p>(same for me ;)</p>



<a name="167407904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167407904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167407904">(Jun 05 2019 at 16:50)</a>:</h4>
<p>in case it's useful, this should be a small program which would need subsets to be propagated along the CFG to emit an error:</p>
<div class="codehilite"><pre><span></span>universal_regions { }
block B0 {
    outlives(&#39;r1: &#39;r0);
    borrow_region_at(&#39;r2, L0), outlives(&#39;r2: &#39;r1), region_live_at(&#39;r0), region_live_at(&#39;r1);
    invalidates(L0), region_live_at(&#39;r0);
}
</pre></div>



<a name="167408081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167408081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167408081">(Jun 05 2019 at 16:52)</a>:</h4>
<p>(I think :p)</p>



<a name="167428831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167428831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167428831">(Jun 05 2019 at 20:47)</a>:</h4>
<p>and if we need more examples, the <code>vec-push-ref</code> cases in our input facts dataset also need this CFG propagation (and they're similar to the examples at the start of this thread)</p>



<a name="167429025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167429025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167429025">(Jun 05 2019 at 20:49)</a>:</h4>
<p>(I seem to have lost my bugpoint-like tool for helping reduce NLL facts automatically; I might have to reduce datalog facts manually like they used to do in the 18th century)</p>



<a name="167441855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167441855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167441855">(Jun 06 2019 at 00:33)</a>:</h4>
<blockquote>
<p>and if we need more examples, the <code>vec-push-ref</code> cases in our input facts dataset also need this CFG propagation (and they're similar to the examples at the start of this thread)</p>
</blockquote>
<p>I was just thinking about this example</p>



<a name="167441857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167441857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167441857">(Jun 06 2019 at 00:33)</a>:</h4>
<p>and wondering how it related</p>



<a name="167442033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167442033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167442033">(Jun 06 2019 at 00:37)</a>:</h4>
<p>btw <span class="user-mention" data-user-id="116113">@lqd</span> I <em>think</em> <a href="https://github.com/rust-lang-nursery/polonius/issues/107" target="_blank" title="https://github.com/rust-lang-nursery/polonius/issues/107">polonius#107</a> describes a way to prototype this idea</p>



<a name="167456140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167456140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167456140">(Jun 06 2019 at 06:36)</a>:</h4>
<p>thanks for writing that up :) I'll look at it in more detail later today. I don't have the intuition yet that we only needed the propagation for <em>equal</em> regions</p>



<a name="167466839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167466839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167466839">(Jun 06 2019 at 09:48)</a>:</h4>
<p>Noticed an interesting example, <a href="https://github.com/rust-lang/polonius/issues/107#issuecomment-499427026" target="_blank" title="https://github.com/rust-lang/polonius/issues/107#issuecomment-499427026">described here</a>. I'm curious <span class="user-mention" data-user-id="127262">@Aaron Weiss</span> what the Oxide type system would do here.</p>



<a name="167470635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167470635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167470635">(Jun 06 2019 at 10:49)</a>:</h4>
<p>(in a rare display of bad luck, reducing the "propagating subsets along the CFG is sometimes necessary"-case -- ensuring the error is emitted -- effectively turned it into the "propagating subsets along the CFG is sometimes imprecise"-case, so my previous example shows the error which <em>shouldn't appear</em>)</p>



<a name="167475777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167475777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167475777">(Jun 06 2019 at 12:15)</a>:</h4>
<blockquote>
<p>Noticed an interesting example, <a href="https://github.com/rust-lang/polonius/issues/107#issuecomment-499427026" target="_blank" title="https://github.com/rust-lang/polonius/issues/107#issuecomment-499427026">described here</a>. I'm curious <span class="user-mention silent" data-user-id="127262">Aaron Weiss</span> what the Oxide type system would do here.</p>
</blockquote>
<p>to continue on this point though, even if <code>equal</code> must be propagated along the CFG, that is still potentially more efficient that <code>subset</code>. This is because the equal relation is <em>reflexive</em>, so in principle we ought to be implement it nicely.</p>
<p>One related thing I've been wondering about is the connection to <em>liveness</em>. A key part of the polonius analysis is removing tuples that touch on dead regions, but that feels like it is serving a <em>similar</em> purpose to this new twist -- i.e., helping to separate "instantaneous behavior" from a "continuous connection". (Witness that to reproduce the imprecision in my origin example, I had to introduce tuples to sidestep the liveness analysis.)</p>



<a name="167493977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167493977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167493977">(Jun 06 2019 at 15:46)</a>:</h4>
<blockquote>
<p>Noticed an interesting example, <a href="https://github.com/rust-lang/polonius/issues/107#issuecomment-499427026" target="_blank" title="https://github.com/rust-lang/polonius/issues/107#issuecomment-499427026">described here</a>. I'm curious <span class="user-mention silent" data-user-id="127262">Aaron Weiss</span> what the Oxide type system would do here.</p>
</blockquote>
<p>Since Oxide only requires type information to be on the same page at the <em>end</em> of the branches, I <em>think</em> this example should work in a fairly straightforward manner. Locally, within each branch, the provenance stuff works out, and at the end of the branch, they both agree on the state of the world (so there's not even a question of "whether or not unifying the two states will succeed").</p>



<a name="167509621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167509621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167509621">(Jun 06 2019 at 18:42)</a>:</h4>
<p>(I quickly prototyped this and it <em>seems to pass the repo's tests</em> — I wasn't able to try on rustc's yet. In particular the <code>vec-push-ref</code> ones pass, and they seem to depend on cfg propagation for some reason — still unsure why as of now. Still, I must have made some mistake in that it may not be working/OOMs on clap)</p>



<a name="167528298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167528298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167528298">(Jun 06 2019 at 22:20)</a>:</h4>
<p>the question <span class="user-mention" data-user-id="127262">@Aaron Weiss</span> is whether the type of <code>p</code>, <code>a</code> and <code>b</code> will have to use the same provenance for the <code>&amp;u32</code></p>



<a name="167528519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167528519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167528519">(Jun 06 2019 at 22:22)</a>:</h4>
<p>Ah, I think with how T-Assign is setup right now, the answer is yes.</p>



<a name="167528718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167528718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167528718">(Jun 06 2019 at 22:25)</a>:</h4>
<p>Actually, I'm not so sure. It might work in Oxide if they're different as long as they're provenances that _can_ unify (i.e. they're not unrelated parameterized provenance variables).</p>



<a name="167528740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/167528740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Weiss <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#167528740">(Jun 06 2019 at 22:25)</a>:</h4>
<p>This is definitely something I should try when I actually manage to get the implementation working.</p>



<a name="170438155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170438155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170438155">(Jul 09 2019 at 09:41)</a>:</h4>
<p>I worked on this last night, and even if I’m not 100% sure of the new behavior (I feel it’s computing <em>a lot</em> more "requires" than before, therefore slower) I also had a tiny thought that had some interesting results: historically we used to compute every "borrow_live_at", and I didn’t expect limiting those to only track invalidated loans would be that impactful. With this, the prototype passes clap fast (most of the new computation seems about previously untracked regions, and is mostly ignored with this filter), and so I also tried tracking equality across the CFG, and that seems to work as well, no "polonius-imprecision unnecessary-error" or with your example in the issue "polonius-imprecision flow-sensitive-equality-required" <span class="user-mention" data-user-id="116009">@nikomatsakis</span> :) I’ll test in rustc later today, these tests were only in the polonius inputs.</p>



<a name="170438735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170438735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170438735">(Jul 09 2019 at 09:50)</a>:</h4>
<p>(I'm not sure on how exactly to control the equality propagation yet, and it might be a coincidence that both tests and the new issue pass, until I've verified in rustc; but I only propagated equality in the cfg if both equal regions were live at the end point of the edge — this might indeed require changing)</p>



<a name="170439986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170439986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170439986">(Jul 09 2019 at 10:12)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> I'm not quite sure what you mean -- you implemented the filter on the existing rules, you mean?</p>



<a name="170439992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170439992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170439992">(Jul 09 2019 at 10:12)</a>:</h4>
<p>Is this code in an open PR?</p>



<a name="170440082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440082">(Jul 09 2019 at 10:14)</a>:</h4>
<p>yes, on both the existing rules and the different versions of the prototype; not yet in a PR though, it's on top of <a href="https://github.com/lqd/borrow-check/tree/variant_prototype" target="_blank" title="https://github.com/lqd/borrow-check/tree/variant_prototype">this branch</a></p>



<a name="170440094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440094">(Jul 09 2019 at 10:14)</a>:</h4>
<p>I can update the branch if you want ?</p>



<a name="170440837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440837">(Jul 09 2019 at 10:26)</a>:</h4>
<p>I'm a bit wary of said filter changing behavior</p>



<a name="170440859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440859">(Jul 09 2019 at 10:27)</a>:</h4>
<p>Unless you're saying that it's just running faster but getting same results</p>



<a name="170440885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440885">(Jul 09 2019 at 10:27)</a>:</h4>
<p>I guess i'd like to take a look at the original, unfiltered version of your new analysis</p>



<a name="170440886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440886">(Jul 09 2019 at 10:27)</a>:</h4>
<p>I hope it's not changing results but will check on the test suite later today</p>



<a name="170440889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440889">(Jul 09 2019 at 10:27)</a>:</h4>
<p>is that still in the branch? it's something I've been meaning to return to</p>



<a name="170440949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440949">(Jul 09 2019 at 10:28)</a>:</h4>
<p>but basically what I mean is I'm filteting borrow regions to only look at loans which might be invalidated</p>



<a name="170440961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440961">(Jul 09 2019 at 10:28)</a>:</h4>
<p>that changes results of computing all the borrow live at tuples, but those are only useful joined with invalidations</p>



<a name="170440988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170440988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170440988">(Jul 09 2019 at 10:29)</a>:</h4>
<p>that is, I feel I'm only tracking the loans which matter now, instead of all loans</p>



<a name="170441019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441019">(Jul 09 2019 at 10:29)</a>:</h4>
<p>Cool -- definitely something I wanted to try doing.</p>



<a name="170441079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441079">(Jul 09 2019 at 10:30)</a>:</h4>
<p>I'm not really sure what my expectations were, but I can imagine it being a big win</p>



<a name="170441084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441084">(Jul 09 2019 at 10:30)</a>:</h4>
<p>a bit like we talked about reusing the results of the location insensitive analysis, limiting the full analysis to only those loans; instead it's the limiting it to the invalidated loans</p>



<a name="170441099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441099">(Jul 09 2019 at 10:30)</a>:</h4>
<p>again I hope to validate rustc's behavior with the tests first but it was interesting yes :)</p>



<a name="170441111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441111">(Jul 09 2019 at 10:30)</a>:</h4>
<blockquote>
<p>a bit like we talked about reusing the results of the location insensitive analysis, limiting the full analysis to only those loans; instead it's the limiting it to the invalidated loans</p>
</blockquote>
<p>yeah good point, maybe we didn't consider this variant? I can't remember.</p>



<a name="170441138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441138">(Jul 09 2019 at 10:31)</a>:</h4>
<p>it doesn't ring a bell which is weird cause it seems "obvious"</p>



<a name="170441142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441142">(Jul 09 2019 at 10:31)</a>:</h4>
<p>Indeed</p>



<a name="170441149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441149">(Jul 09 2019 at 10:31)</a>:</h4>
<p>Ah well</p>



<a name="170441152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441152">(Jul 09 2019 at 10:31)</a>:</h4>
<p>but we've prototyped the other information sharing in the hybrid variant</p>



<a name="170441153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441153">(Jul 09 2019 at 10:31)</a>:</h4>
<p>I think maybe this arises from</p>



<a name="170441157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441157">(Jul 09 2019 at 10:31)</a>:</h4>
<p><code>&amp;*x</code> where <code>x: &amp;T</code>?</p>



<a name="170441170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441170">(Jul 09 2019 at 10:32)</a>:</h4>
<p>i.e., if you borrow <code>&amp;x</code> and <code>x</code> is immutable, it will have a <code>StorageDead</code> that invalidates it</p>



<a name="170441214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441214">(Jul 09 2019 at 10:32)</a>:</h4>
<p>but if you are borrowing <code>&amp;*x</code> it may never</p>



<a name="170441219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441219">(Jul 09 2019 at 10:32)</a>:</h4>
<p>we optimize this case in "normal" NLL, too</p>



<a name="170441224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441224">(Jul 09 2019 at 10:32)</a>:</h4>
<p>still feels strange that this kinda fixes the prototype on clap (so I'd like to investigate more here ofc; that might mean that clap is fine but some other case where most borrow regions are invalidated will still be slow on datafrogopt or the prototype)</p>



<a name="170441260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441260">(Jul 09 2019 at 10:33)</a>:</h4>
<p>yeah this may be a good optimization but perhaps ultimately less good than the insensitive variant (and, of course, you could probably apply it there too, no?)</p>



<a name="170441674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441674">(Jul 09 2019 at 10:39)</a>:</h4>
<p>I did yeah :)</p>



<a name="170441676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441676">(Jul 09 2019 at 10:39)</a>:</h4>
<p>everywhere</p>



<a name="170441782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170441782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170441782">(Jul 09 2019 at 10:40)</a>:</h4>
<p>it's a bit subtle to see since the borrow regions are straight out of rustc, so the relation's content is a bit most obvious there</p>



<a name="170442855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170442855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170442855">(Jul 09 2019 at 10:57)</a>:</h4>
<p>here's the updated prototype niko: <a href="https://github.com/lqd/borrow-check/commit/262e42b2dbe76cfde9c3dee6c108224186275feb" target="_blank" title="https://github.com/lqd/borrow-check/commit/262e42b2dbe76cfde9c3dee6c108224186275feb">link</a></p>



<a name="170442948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170442948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170442948">(Jul 09 2019 at 10:59)</a>:</h4>
<p>still feels like it might work thanks to luck, so I'll want to understand more of the behaviour without this filtering (and without the flow sensitive equality present in this commit)</p>



<a name="170442958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170442958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170442958">(Jul 09 2019 at 10:59)</a>:</h4>
<p>but it seemed like it was tracking at least 10x more <code>requires</code></p>



<a name="170443038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443038">(Jul 09 2019 at 11:01)</a>:</h4>
<blockquote>
<p>here's the updated prototype niko: <a href="https://github.com/lqd/borrow-check/commit/262e42b2dbe76cfde9c3dee6c108224186275feb" target="_blank" title="https://github.com/lqd/borrow-check/commit/262e42b2dbe76cfde9c3dee6c108224186275feb">link</a></p>
</blockquote>
<p>this is pre-optimization, right?</p>



<a name="170443051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443051">(Jul 09 2019 at 11:01)</a>:</h4>
<blockquote>
<p>but it seemed like it was tracking at least 10x more <code>requires</code></p>
</blockquote>
<p>I wanted to check how you implemented it, this seems plausible, but I suspect we can cut it down in other ways too</p>



<a name="170443059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443059">(Jul 09 2019 at 11:01)</a>:</h4>
<p>actually, it's with the optimization</p>



<a name="170443065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443065">(Jul 09 2019 at 11:01)</a>:</h4>
<p>ah ok</p>



<a name="170443175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443175">(Jul 09 2019 at 11:02)</a>:</h4>
<p>the optimization is <a href="https://github.com/lqd/borrow-check/commit/262e42b2dbe76cfde9c3dee6c108224186275feb#diff-d5df4d540115464d1451e38b7f0acf7aR167" target="_blank" title="https://github.com/lqd/borrow-check/commit/262e42b2dbe76cfde9c3dee6c108224186275feb#diff-d5df4d540115464d1451e38b7f0acf7aR167">this</a></p>



<a name="170443189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443189">(Jul 09 2019 at 11:03)</a>:</h4>
<p>+1</p>



<a name="170443199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443199">(Jul 09 2019 at 11:03)</a>:</h4>
<p>I fear it's just optimizing clap tho :)</p>



<a name="170443229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443229">(Jul 09 2019 at 11:03)</a>:</h4>
<p>(or cases where the set of invalidated loans is lower than the set of borrow regions' loans, say)</p>



<a name="170443274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443274">(Jul 09 2019 at 11:04)</a>:</h4>
<p>well, if it's the <code>&amp;*x</code> case that I was describing, then I think it's more general than that</p>



<a name="170443283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443283">(Jul 09 2019 at 11:04)</a>:</h4>
<p>I'd like to investigate if it's those indeed</p>



<a name="170443287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443287">(Jul 09 2019 at 11:04)</a>:</h4>
<p>though I suspect the <em>best</em> would be to (a) use this optimization for the flow insensitive variant and then (b) use results from flow insensitive variant to inform the flow sensitive version</p>



<a name="170443294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443294">(Jul 09 2019 at 11:04)</a>:</h4>
<p>yeah true</p>



<a name="170443410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443410">(Jul 09 2019 at 11:06)</a>:</h4>
<p>optimizations while the correctness story is still a bit in flux feels strange, but we've already prototyped the sharing between the 2 variants so I'm not worried we can do these easy and effective optimizations there</p>



<a name="170443590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443590">(Jul 09 2019 at 11:10)</a>:</h4>
<p>I have hopes to do a lot of this before you return from vacation :)</p>



<a name="170443637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443637">(Jul 09 2019 at 11:11)</a>:</h4>
<p>(ofc the prototype is terrible WIP, I split it into 2 computations just so I could control the equality in rust, but it's probably doable in datafrog)</p>



<a name="170443687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170443687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170443687">(Jul 09 2019 at 11:12)</a>:</h4>
<p>(I gtg for a bit and then I can test this in rustc)</p>



<a name="170471792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170471792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170471792">(Jul 09 2019 at 17:14)</a>:</h4>
<p>ran this variant on rustc tests, only 15 more failures, impressive</p>



<a name="170471818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170471818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170471818">(Jul 09 2019 at 17:14)</a>:</h4>
<p>some of them look bad though, like compiling things which probably shouldn't compile :)</p>



<a name="170472024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/subset%20relations%20and%20polonius/near/170472024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/subset.20relations.20and.20polonius.html#170472024">(Jul 09 2019 at 17:17)</a>:</h4>
<p>polonius is like "you may not like it but this is what peak borrowcking looks like" -- I'll thin those out over the summer, so we know why it's doing this, probably just bugs rather than unsoundness (otherwise we might have heard about it from aatxe)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>